<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="java.util.*" %>
    <%@ page import="com.wgh.student" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>学生信息</title>

</head>
<body>
<div width="98%" align="center">
<h2>所有学生信息</h2>
</div>
<table width="98%" border="0" align=" center" cellpadding="0" cellspacing="1" bgcolor="#666666">
<tr>
<th bgcolor="#FFFFFFF">ID</th>
<th bgcolor="#FFFFFFF">姓名</th>
<th bgcolor="#FFFFFFF">兴趣</th>
<th bgcolor="#FFFFFFF">修改</th>

</tr>
<%
    List<student> list = (List<student>) request.getAttribute("list");
    if (list == null || list.size()<1){
    out.print("<tr><td bgcolor='#FFFFFF' colspan= '5'>没有任何学生信息！</td></tr>");
    }else{
    for (student stu : list){
    %>
    <tr align="center">
    <td bgcolor="#FFFFFFF"><%=stu.getid() %></td>
    <td bgcolor="#FFFFFFF"><%=stu.getname() %></td>
    <td bgcolor="#FFFFFFF"><%=stu.getinteresting() %></td>
    <td bgcolor="#FFFFFFF">
    <form action="Updatestudent1" method="post" onsubmit="return check(this);">
    <input type="hidden" name="id" value="<%=stu.getid() %>">
    <input type="text" name="interesting" size="3">
    <input type="submit" value="修改">
    </form> 
    <a href="Deletestudent?id=<%=stu.getid()%>">删除</a>
               
    </td>
    </tr>
    <%
    }
    }
    %>
    </table>
    <a href="count.jsp">统计学生人数</a>
</body>
</html>